package com.csu54sher.basereservation.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalTime;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 可预约时间表
 * </p>
 *
 * @author csu54sher
 * @since 2025-10-19
 */
@Getter
@Setter
@TableName("reservable_time")
public class ReservableTime extends Model<ReservableTime> {

    private static final long serialVersionUID = 1L;

    /**
     * 时段ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 可预约时间所在日期,，不存储时间，只存储日期
     */
    @TableField("date")
    private LocalDate date;

    /**
     * 开始时间，只存储时间，不存储日期
     */
    @TableField("start_time")
    private LocalTime startTime;

    /**
     * 结束时间，只存储时间，不存储日期
     */
    @TableField("end_time")
    private LocalTime endTime;

    /**
     * 是否已经被预约
     */
    @TableField("is_reserved")
    private Byte isReserved;

    /**
     * 基地ID
     */
    @TableField("base_id")
    private Integer baseId;

    public static final String ID = "id";

    public static final String DATE = "date";

    public static final String START_TIME = "start_time";

    public static final String END_TIME = "end_time";

    public static final String IS_RESERVED = "is_reserved";

    public static final String BASE_ID = "base_id";

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
